use serde::{Serialize,Deserialize};


#[derive(Clone,Debug,Deserialize,Serialize)]
pub struct UnixRequest {
    pub name:String,
    pub namespace:String,
    #[serde(rename="type")]
    pub typ:String,
}

impl Default for UnixRequest {
    fn default() -> Self {
        UnixRequest{
            name: "".to_string(),
            namespace: "default".to_string(),
            typ: "pod".to_string()
        }
    }
}

impl UnixRequest {
    pub fn to_vec(&self) -> Vec<u8> {
        serde_json::to_vec(self).unwrap()
    }
}